function getPayCount() {
    let result = 1;
    // 获取流水号
    let payCount = JSON.parse(localStorage.getItem('payCount'));
    let now = new Date();
    if (!payCount) {
        // 若流水号不存在, 则新建
        payCount = {
            'value': 1,
            'expiration': new Date(new Date(now.getTime() + 24 * 60 * 60 * 1000).toLocaleDateString()).getTime()
        }
    } else {
        // 如果流水号数据存在, 则判断是否过期, 过期则新建
        let expiration = payCount.expiration;
        if (expiration <= now) {
            payCount = {
                'value': 1,
                'expiration': new Date(new Date(now.getTime() + 24 * 60 * 60 * 1000).toLocaleDateString()).getTime()
            }
        }
    }
    result = payCount.value;
    // 更新流水
    payCount.value += 1;
    localStorage.setItem('payCount', JSON.stringify(payCount));
    return result;
}

function formatPayCount(value){
    if(value < 10){
        return "00"+value;
    }else if(value <100){
        return "0"+value;
    }else if(value <=999){
        return value.toString();
    }
}
